


class RendererV1{
    constructor(camera) {
        this._camera = camera;
        this._entitys = [];
    }

    add(entity){
        this._entitys.push(entity);
    }

    update(){
        let camera = this._camera;
        camera.update();

        this._entitys.forEach(entity=>{
            if(entity.update){
                entity.update();
            }
        });
    }

    render(){
        let camera = this._camera;

        this._entitys.forEach(entity=>{
            entity.cullFace(camera);
            entity.render(camera);
        });
    }
}


export default RendererV1;




